<template>
    <view class="globe_back">
        <z-paging ref="paging" v-model="list" @query="queryList">
            <view slot="top">
                <view class="box">
                    <view class="flex tipbox">
                        <view :class="tipIndex == item.id ? 'tipActive' : 'tip'" @click="tip(item.id)" v-for="item in tiptext">{{ item.name }}</view>
                    </view>
                    <view class="flex">
                        <view :class="tabIndex == item.id ? 'tabActive' : 'tab'" @click="navtab(item.id)" v-for="item in tab">{{ item.name }}</view>
                    </view>
                </view>
            </view>
            <view class="box">
                <!-- 列表 -->
                <view class="listBox">
                    <view class="back_fff list">
                        <view class="flex justify_content_between">
                            <view class="type">待支付</view>
                            <view class="time">2023-12-02 12:15</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round"></view>
                            <view class="title">上门检修故障</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round" style="background: #3377ff"></view>
                            <view class="title">
                                <view class="address">贵阳市南明区花果园金融街一号老凤祥</view>
                                <view>
                                    <text class="name">王先生</text>
                                    <text class="iphone">156****5412</text>
                                </view>
                            </view>
                        </view>
                        <view class="money pt_24">
                            费用
                            <text>￥20.12</text>
                        </view>
                        <view class="flex btn justify_content_end">
                            <view class="cance">取消订单</view>
                            <view class="buy" @click="buybtn(0)">立即付款</view>
                        </view>
                    </view>
                    <!-- 待接单 -->
                    <view class="back_fff list">
                        <view class="flex justify_content_between">
                            <view class="type">待接单</view>
                            <view class="time">2023-12-02 12:15</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round"></view>
                            <view class="title">上门检修故障</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round" style="background: #3377ff"></view>
                            <view class="title">
                                <view class="address">贵阳市南明区花果园金融街一号老凤祥</view>
                                <view>
                                    <text class="name">王先生</text>
                                    <text class="iphone">156****5412</text>
                                </view>
                            </view>
                        </view>
                        <view class="money pt_24">
                            费用
                            <text>￥20.12</text>
                        </view>
                        <view class="flex btn justify_content_end">
                            <view class="cance">取消订单</view>
                            <view class="buy" @click="buybtn(1)">订单详情</view>
                        </view>
                    </view>
                    <!-- 进行中 -->
                    <view class="back_fff list">
                        <view class="flex justify_content_between">
                            <view class="type">进行中</view>
                            <view class="time">2023-12-02 12:15</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round"></view>
                            <view class="title">
                                <view class="address">接单员正在赶往服务位置</view>
                                <view style="font-weight: normal">
                                    距服务位置
                                    <text class="name">1.5km</text>
                                    ，预计5分钟内到达
                                </view>
                            </view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round" style="background: #3377ff"></view>
                            <view class="title">
                                <view class="address">贵阳市南明区花果园金融街一号老凤祥</view>
                                <view>
                                    <text class="name">王先生</text>
                                    <text class="iphone">156****5412</text>
                                </view>
                            </view>
                        </view>
                        <view class="money pt_24">
                            费用
                            <text>￥20.12</text>
                        </view>
                        <view class="flex btn justify_content_end">
                            <view class="cance">取消订单</view>
                            <view class="buy" @click="inProgress">订单详情</view>
                        </view>
                    </view>
                    <!-- 进行中，完成 -->
                    <view class="back_fff list">
                        <view class="flex justify_content_between">
                            <view class="type">进行中</view>
                            <view class="time">2023-12-02 12:15</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round"></view>
                            <view class="title">
                                <view class="address">接单员正在赶往开锁位置</view>
                                <view style="font-weight: normal">
                                    距开锁位置
                                    <text class="name">1.5km</text>
                                    ，预计5分钟内到达
                                </view>
                            </view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round" style="background: #3377ff"></view>
                            <view class="title">
                                <view class="address">贵阳市南明区花果园金融街一号老凤祥</view>
                                <view>
                                    <text class="name">王先生</text>
                                    <text class="iphone">156****5412</text>
                                </view>
                            </view>
                        </view>
                        <view class="money pt_24">
                            费用
                            <text>￥20.12</text>
                        </view>
                        <view class="flex btn justify_content_end">
                            <view class="cance">取消订单</view>
                            <view class="buy" @click="buybtn(2)">完成服务</view>
                        </view>
                    </view>
                    <!-- 已完成 -->
                    <view class="back_fff list">
                        <view class="flex justify_content_between">
                            <view class="type">已完成</view>
                            <view class="time">2023-12-02 12:15</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round"></view>
                            <view class="title">其他服务</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round" style="background: #3377ff"></view>
                            <view class="title">
                                <view class="address">贵阳市南明区花果园金融街一号老凤祥</view>
                                <view>
                                    <text class="name">王先生</text>
                                    <text class="iphone">156****5412</text>
                                </view>
                            </view>
                        </view>
                        <view class="money pt_24">
                            费用
                            <text>￥20.12</text>
                        </view>
                        <view class="flex btn justify_content_end">
                            <view class="cance">取消订单</view>
                            <view class="buy" @click="evaluate">去评价</view>
                        </view>
                    </view>
                    <!-- 售后中 -->
                    <view class="back_fff list">
                        <view class="flex justify_content_between">
                            <view class="type">售后中</view>
                            <view class="time">2023-12-02 12:15</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round"></view>
                            <view class="title">汽车起火</view>
                        </view>
                        <view class="flex justify_content_between pt_24">
                            <view class="round" style="background: #3377ff"></view>
                            <view class="title">
                                <view class="address">贵阳市南明区花果园金融街一号老凤祥</view>
                                <view>
                                    <text class="name">王先生</text>
                                    <text class="iphone">156****5412</text>
                                </view>
                            </view>
                        </view>
                        <view class="money pt_24">
                            费用
                            <text>￥20.12</text>
                        </view>
                        <view class="flex btn justify_content_end">
                            <view class="cance">取消订单</view>
                            <view class="buy" @click="AfterSalesDetails">售后详情</view>
                        </view>
                    </view>
                </view>
            </view>
        </z-paging>
    </view>
</template>

<script>
export default {
    data() {
        return {
            tipIndex: 5,
            tabIndex: 1,
            tiptext: [
                { name: '服务', id: 1 },
                { name: '租车', id: 2 },
                { name: '商城', id: 3 },
                { name: '拖车', id: 4 },
                { name: '开锁', id: 5 }
            ],
            tab: [
                {
                    name: '全部',
                    id: 1
                },
                {
                    name: '待支付',
                    id: 2
                },
                {
                    name: '待接单',
                    id: 3
                },
                {
                    name: '进行中',
                    id: 4
                },
                {
                    name: '已完成',
                    id: 5
                },
                {
                    name: '售后',
                    id: 6
                }
            ],
            list: [
                {
                    type: '待支付',
                    time: '2023-12-15 12:25',
                    title: '租用电池',
                    address: '贵阳市南明区花果园金融街一号老凤祥贵阳市南明区花',
                    name: '王先生',
                    phone: '156****5412',
                    money: '2001.00'
                }
            ]
        };
    },
    methods: {
        tip(e) {
            this.tipIndex = e;
        },
        navtab(e) {
            this.tabIndex = e;
        },
        click(item) {
            console.log('item', item);
        },
        buybtn(id) {
            uni.navigateTo({
                url: '/pages/me/MyOrder/UnlockDetails?type=' + id
            });
        },
        evaluate() {
            uni.navigateTo({
                url: '/pages/me/MyOrder/evaluate'
            });
        },
        AfterSalesDetails() {
            uni.navigateTo({
                url: '/pages/me/MyOrder/AfterSalesDetails'
            });
        },
        inProgress() {
            uni.navigateTo({
                url: '/pages/me/MyOrder/UnlockToProceed'
            });
        }
    }
};
</script>

<style scoped lang="scss">
.box {
    padding: 0 32rpx;
}
.tipbox {
    background: #f7f7f7;
    border-radius: 8rpx;
    color: #666b75;
    font-size: 28rpx;
    padding: 8rpx;
}
.tip {
    padding: 16rpx;
    border-radius: 8rpx;
}
.tipActive {
    background: white;
    color: #00091a;
    padding: 16rpx;
    border-radius: 8rpx;
}
.tab {
    color: #999ca3;
    font-size: 28rpx;
    margin: 19rpx;
}
.tabActive {
    color: #3377ff;
    font-size: 32rpx;
    margin: 19rpx;
    font-weight: bold;
}
.list {
    padding: 24rpx;
    border-radius: 24rpx;
    margin-top: 24rpx;
    .round {
        width: 16rpx;
        height: 16rpx;
        border-radius: 50%;
        background: #00091a;
        font-size: 28rpx;
        margin-top: 16rpx;
    }
    .type {
        color: #3377ff;
        font-weight: bold;
    }
    .time {
        color: #ccced1;
    }
    .title {
        width: 90%;
        color: #00091a;
        font-size: 32rpx;
        font-weight: bold;
    }
    .address {
        display: inline-block;
        white-space: nowrap;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .name {
        font-weight: normal;
        color: #333a47;
        margin-right: 24rpx;
    }
    .iphone {
        font-weight: normal;
        color: #999ca3;
    }
    .money {
        text-align: right;
        color: #666b75;
    }
    .money text {
        color: #ff6401;
        font-weight: bold;
        font-size: 32rpx;
    }
    .btn {
        text-align: right;
    }
    .cance {
        width: 160rpx;
        height: 68rpx;
        line-height: 68rpx;
        border-radius: 8rpx;
        color: #666b75;
        text-align: center;
        border: 2rpx solid #ccced1;
        margin-top: 24rpx;
    }
    .buy {
        width: 160rpx;
        height: 68rpx;
        line-height: 68rpx;
        border-radius: 8rpx;
        color: #ffffff;
        text-align: center;
        background: #3377ff;
        margin-left: 24rpx;
        margin-top: 24rpx;
    }
}
</style>
